package org.tcs.com.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.tcs.com.model.Incident;

import com.googlecode.genericdao.dao.hibernate.original.GenericDAOImpl;

@Repository
public class IncidentDAOImpl extends GenericDAOImpl<Incident, Long> implements IncidentDAO{

	@Override
	@Autowired
	public void setSessionFactory(SessionFactory sessionFactory) {
		super.setSessionFactory(sessionFactory);
	}
	
	/**
	 * Get the current Hibernate session
	 */
	@Override
	protected Session getSession() {
		return this.getSessionFactory().openSession();
	}
}
